#include "derivative.h" /* include peripheral declarations */
#include "PAP_defs.h"

#define TPM_PRESCALER_1 0
#define TPM_PRESCALER_2 1
#define TPM_PRESCALER_4 2
#define TPM_PRESCALER_8 3
#define TPM_PRESCALER_16 4
#define TPM_PRESCALER_32 5
#define TPM_PRESCALER_64 6
#define TPM_PRESCALER_128 7

#define TPM_LOW_TRUE 1
#define TPM_HIGH_TRUE 2

#define TPM_RISING_EDGE 1
#define TPM_FALLING_EDGE 2
#define TPM_RISING_OR_FALLING_EDGE 3

#define TPM_SOFTWARE_COMPARE 0
#define TPM_TOGGLE_OUTPUT 1
#define TPM_CLEAR_OUTPUT 2
#define TPM_SET_OUTPUT 3

#define TPM_CLK_DISABLE 0
#define TPM_CLK_BUS     1
#define TPM_CLK_XCLK    2
#define TPM_CLK_EXTERNAL 3 

void vfnTPM_ChannelInterruptEnable (uint8 u8channel);

void vfnTPM_SelectClock (uint8 u8clock);

void vfnTPM_SetPrescalerDivider (uint8 u8prescaler);

void vfnTPM_SetModulo (uint16 u16modulo);

void vfnTPM_ClearChannelFlag (uint8 u8channel);

void vfnTPM_ChannelInputCapture (uint8 u8channel,uint8 u8config);

uint16 u16TPM_CheckChannelValue (uint8 u8channel);

